home *** CD-ROM | disk | FTP | other *** search
/ CD/PC Actual 76 / DVD Actual 1 Marzo 2003.iso / Trial / TurboCAD 7.1 Pro / Data.Cab / F25710_DatRef.cls < prev    next >
Encoding:
Visual Basic class definition  |  2000-11-10  |  54.4 KB  |  1,709 lines

  1. VERSION 1.0 CLASS
  2. BEGIN
  3.   MultiUse = -1  'True
  4.   Persistable = 0  'NotPersistable
  5.   DataBindingBehavior = 0  'vbNone
  6.   DataSourceBehavior  = 0  'vbNone
  7.   MTSTransactionMode  = 0  'NotAnMTSObject
  8. END
  9. Attribute VB_Name = "ANSI"
  10. Attribute VB_GlobalNameSpace = False
  11. Attribute VB_Creatable = True
  12. Attribute VB_PredeclaredId = False
  13. Attribute VB_Exposed = True
  14. Option Explicit
  15. '/******************************************************************/
  16. '/*                                                                */
  17. '/*                      TurboCAD for Windows                      */
  18. '/*                   Copyright (c) 1993 - 2000                    */
  19. '/*             International Microcomputer Software, Inc.         */
  20. '/*                            (IMSI)                              */
  21. '/*                      All rights reserved.                      */
  22. '/*                                                                */
  23. '/******************************************************************/
  24.  
  25. 'DBAPI constants
  26. Const gkGraphic = 11
  27. Const gkArc = 2
  28. Const gkText = 6
  29. Const gfCosmetic = 128&
  30.  
  31. 'Useful math constants
  32. Const pi# = 3.14159265
  33.  
  34. 'Real variant types!
  35. Const typeEmpty = 0
  36. Const typeInteger = 2
  37. Const typeLong = 3
  38. Const typeSingle = 4
  39. Const typeDouble = 5
  40. Const typeCurrency = 6
  41. Const typeDate = 7
  42. Const typeString = 8
  43. Const typeObject = 9
  44. Const typeBoolean = 11
  45. Const typeVariant = 12
  46. Const typeIntegerEnum = typeInteger + 100
  47. Const typeLongEnum = typeLong + 100
  48. Const typeStringEnum = typeString + 100
  49.  
  50. 'Stock property pages
  51. Const ppStockPen = 1
  52. Const ppStockBrush = 2
  53. Const ppStockText = 4
  54. Const ppStockInsert = 8
  55. Const ppStockViewport = 16
  56. Const ppStockAuto = 32
  57.  
  58. 'Property Ids
  59.     ' Table-1
  60. Const idImg11 = 11
  61. Const idImg12 = 12
  62. Const idImg13 = 13
  63. Const idImg14 = 14
  64. Const idImg15 = 15
  65. Const idImg16 = 16
  66. Const idImg17 = 17
  67. Const idImg18 = 18
  68.  
  69. Const idImgFont11 = 51
  70. Const idImgFont12 = 52
  71. Const idImgFont13 = 53
  72. Const idImgFont14 = 54
  73. Const idImgFont15 = 55
  74. Const idImgFont16 = 56
  75. Const idImgFont17 = 57
  76. Const idImgFont18 = 58
  77.  
  78. Const idTxt11 = 101
  79. Const idTxt12 = 102
  80. Const idTxt13 = 103
  81. Const idTxt14 = 104
  82. Const idTxt15 = 105
  83.  
  84.     ' Table-2
  85. Const idImg21 = 21
  86. Const idImg22 = 22
  87. Const idImg23 = 23
  88. Const idImg24 = 24
  89. Const idImg25 = 25
  90. Const idImg26 = 26
  91. Const idImg27 = 27
  92. Const idImg28 = 28
  93.  
  94. Const idImgFont21 = 61
  95. Const idImgFont22 = 62
  96. Const idImgFont23 = 63
  97. Const idImgFont24 = 64
  98. Const idImgFont25 = 65
  99. Const idImgFont26 = 66
  100. Const idImgFont27 = 67
  101. Const idImgFont28 = 68
  102.  
  103. Const idTxt21 = 201
  104. Const idTxt22 = 202
  105. Const idTxt23 = 203
  106. Const idTxt24 = 204
  107. Const idTxt25 = 205
  108.  
  109.     ' Table-3
  110. Const idImg31 = 31
  111.  
  112. Const idImgFont31 = 71
  113.  
  114. Const idTxt31 = 301
  115.  
  116.     ' Table-4
  117. Const idTxt41 = 401
  118.  
  119.     ' Scale
  120. Const idSymTxtHeight = 500
  121.     
  122.     ' Text Font
  123. Const idTextFont = 501
  124.     
  125.     ' LinearUnitName
  126. Const idUnitName = 502
  127.  
  128. 'Property enums
  129.  
  130. 'Number of properties, pages, wizards
  131. Const NUM_PROPERTIES = 49
  132. Const NUM_PAGES = 1
  133. Const NUM_WIZARDS = 0
  134.  
  135. Private Sub Class_Initialize()
  136.     'Initialize class variables
  137. End Sub
  138.  
  139. 'Returns the user-visible description of this RegenMethod
  140. Public Property Get Description() As String
  141.     Description = "Geometric Tolerance"
  142. End Property
  143.  
  144. 'Returns the persistent class id for this RegenMethod's property section
  145. Public Property Get ClassID() As String
  146.     ClassID = "{FDB6F1C4-9631-11d1-A40A-0000B465872B}"
  147.  
  148. End Property
  149.  
  150. 'Retrieve types and names
  151. Public Function GetPropertyInfo(Names As Variant, Types As Variant, _
  152.     IDs As Variant, Defaults As Variant) As Long
  153.     ReDim Names(NUM_PROPERTIES), Types(NUM_PROPERTIES), _
  154.         IDs(NUM_PROPERTIES), Defaults(NUM_PROPERTIES)
  155.         
  156. '-----------------------------------------------------
  157. 'Begin Table-1
  158.     Names(0) = "Image11"
  159.     Types(0) = typeString
  160.     IDs(0) = idImg11
  161.     Defaults(0) = Chr(98)
  162.     
  163.     Names(1) = "Image12"
  164.     Types(1) = typeString
  165.     IDs(1) = idImg12
  166.     Defaults(1) = Chr(110)
  167.        
  168.     Names(2) = "Image13"
  169.     Types(2) = typeString
  170.     IDs(2) = idImg13
  171.     Defaults(2) = Chr(109)
  172.         
  173.     Names(3) = "Image14"
  174.     Types(3) = typeString
  175.     IDs(3) = idImg14
  176.     Defaults(3) = ""
  177.         
  178.     Names(4) = "Image15"
  179.     Types(4) = typeString
  180.     IDs(4) = idImg15
  181.     Defaults(4) = ""
  182.         
  183.     Names(5) = "Image16"
  184.     Types(5) = typeString
  185.     IDs(5) = idImg16
  186.     Defaults(5) = ""
  187.         
  188.     Names(6) = "Image17"
  189.     Types(6) = typeString
  190.     IDs(6) = idImg17
  191.     Defaults(6) = ""
  192.         
  193.     Names(7) = "Image18"
  194.     Types(7) = typeString
  195.     IDs(7) = idImg18
  196.     Defaults(7) = ""
  197.     
  198. ' Fonts for Imiges for the Table-1
  199.     
  200.     Names(30) = "ImageFont11"
  201.     Types(30) = typeString
  202.     IDs(30) = idImgFont11
  203.     Defaults(30) = "gdt.shx"
  204.     
  205.     Names(31) = "ImageFont12"
  206.     Types(31) = typeString
  207.     IDs(31) = idImgFont12
  208.     Defaults(31) = "gdt.shx"
  209.        
  210.     Names(32) = "ImageFont13"
  211.     Types(32) = typeString
  212.     IDs(32) = idImgFont13
  213.     Defaults(32) = "gdt.shx"
  214.         
  215.     Names(33) = "ImageFont14"
  216.     Types(33) = typeString
  217.     IDs(33) = idImgFont14
  218.     Defaults(33) = "gdt.shx"
  219.         
  220.     Names(34) = "ImageFont15"
  221.     Types(34) = typeString
  222.     IDs(34) = idImgFont15
  223.     Defaults(34) = "gdt.shx"
  224.         
  225.     Names(35) = "ImageFont16"
  226.     Types(35) = typeString
  227.     IDs(35) = idImgFont16
  228.     Defaults(35) = "gdt.shx"
  229.         
  230.     Names(36) = "ImageFont17"
  231.     Types(36) = typeString
  232.     IDs(36) = idImgFont17
  233.     Defaults(36) = "gdt.shx"
  234.         
  235.     Names(37) = "ImageFont18"
  236.     Types(37) = typeString
  237.     IDs(37) = idImgFont18
  238.     Defaults(37) = "gdt.shx"
  239.     
  240. ' End fonts for images for the Table-1
  241.     
  242.     
  243.         
  244.     Names(8) = "Text11"
  245.     Types(8) = typeString
  246.     IDs(8) = idTxt11
  247.     Defaults(8) = "0.000"
  248.         
  249.     Names(9) = "Text12"
  250.     Types(9) = typeString
  251.     IDs(9) = idTxt12
  252.     Defaults(9) = ""
  253.         
  254.     Names(10) = "Text13"
  255.     Types(10) = typeString
  256.     IDs(10) = idTxt13
  257.     Defaults(10) = "A"
  258.        
  259.     Names(11) = "Text14"
  260.     Types(11) = typeString
  261.     IDs(11) = idTxt14
  262.     Defaults(11) = "B"
  263.         
  264.     Names(12) = "Text15"
  265.     Types(12) = typeString
  266.     IDs(12) = idTxt15
  267.     Defaults(12) = "C"
  268. 'End Table-1
  269. '-----------------------------------------------------------
  270.         
  271. '-----------------------------------------------------
  272. 'Begin Table-2
  273.     Names(13) = "Image21"
  274.     Types(13) = typeString
  275.     IDs(13) = idImg21
  276.     Defaults(13) = ""
  277.     
  278.     Names(14) = "Image22"
  279.     Types(14) = typeString
  280.     IDs(14) = idImg22
  281.     Defaults(14) = ""
  282.        
  283.     Names(15) = "Image23"
  284.     Types(15) = typeString
  285.     IDs(15) = idImg23
  286.     Defaults(15) = ""
  287.         
  288.     Names(16) = "Image24"
  289.     Types(16) = typeString
  290.     IDs(16) = idImg24
  291.     Defaults(16) = ""
  292.         
  293.     Names(17) = "Image25"
  294.     Types(17) = typeString
  295.     IDs(17) = idImg25
  296.     Defaults(17) = ""
  297.         
  298.     Names(18) = "Image26"
  299.     Types(18) = typeString
  300.     IDs(18) = idImg26
  301.     Defaults(18) = ""
  302.         
  303.     Names(19) = "Image27"
  304.     Types(19) = typeString
  305.     IDs(19) = idImg27
  306.     Defaults(19) = ""
  307.         
  308.     Names(20) = "Image28"
  309.     Types(20) = typeString
  310.     IDs(20) = idImg28
  311.     Defaults(20) = ""
  312.     
  313. ' Fonts for Imiges for the Table-2
  314.     
  315.     Names(38) = "ImageFont21"
  316.     Types(38) = typeString
  317.     IDs(38) = idImgFont21
  318.     Defaults(38) = "gdt.shx"
  319.     
  320.     Names(39) = "ImageFont22"
  321.     Types(39) = typeString
  322.     IDs(39) = idImgFont22
  323.     Defaults(39) = "gdt.shx"
  324.        
  325.     Names(40) = "ImageFont23"
  326.     Types(40) = typeString
  327.     IDs(40) = idImgFont23
  328.     Defaults(40) = "gdt.shx"
  329.         
  330.     Names(41) = "ImageFont24"
  331.     Types(41) = typeString
  332.     IDs(41) = idImgFont24
  333.     Defaults(41) = "gdt.shx"
  334.         
  335.     Names(42) = "ImageFont25"
  336.     Types(42) = typeString
  337.     IDs(42) = idImgFont25
  338.     Defaults(42) = "gdt.shx"
  339.         
  340.     Names(43) = "ImageFont26"
  341.     Types(43) = typeString
  342.     IDs(43) = idImgFont26
  343.     Defaults(43) = "gdt.shx"
  344.         
  345.     Names(44) = "ImageFont27"
  346.     Types(44) = typeString
  347.     IDs(44) = idImgFont27
  348.     Defaults(44) = "gdt.shx"
  349.         
  350.     Names(45) = "ImageFont28"
  351.     Types(45) = typeString
  352.     IDs(45) = idImgFont28
  353.     Defaults(45) = "gdt.shx"
  354.     
  355. ' End fonts for images for the Table-2
  356.         
  357.     Names(21) = "Text21"
  358.     Types(21) = typeString
  359.     IDs(21) = idTxt21
  360.     Defaults(21) = ""
  361.         
  362.     Names(22) = "Text22"
  363.     Types(22) = typeString
  364.     IDs(22) = idTxt22
  365.     Defaults(22) = ""
  366.         
  367.     Names(23) = "Text23"
  368.     Types(23) = typeString
  369.     IDs(23) = idTxt23
  370.     Defaults(23) = ""
  371.        
  372.     Names(24) = "Text24"
  373.     Types(24) = typeString
  374.     IDs(24) = idTxt24
  375.     Defaults(24) = ""
  376.         
  377.     Names(25) = "Text25"
  378.     Types(25) = typeString
  379.     IDs(25) = idTxt25
  380.     Defaults(25) = ""
  381.     
  382. 'End Table-2
  383. '-----------------------------------------------------------
  384.         
  385.         
  386. '-----------------------------------------------------
  387. 'Begin Table-3
  388.     Names(26) = "Image31"
  389.     Types(26) = typeString
  390.     IDs(26) = idImg31
  391.     Defaults(26) = ""
  392.  
  393. ' Fonts for Imiges for the Table-3
  394.     
  395.     Names(46) = "ImageFont31"
  396.     Types(46) = typeString
  397.     IDs(46) = idImgFont31
  398.     Defaults(46) = "gdt.shx"
  399.     
  400. ' End fonts for images for the Table-3
  401.     
  402.     Names(27) = "Text31"
  403.     Types(27) = typeString
  404.     IDs(27) = idTxt31
  405.     Defaults(27) = ""
  406.         
  407. 'End Table-3
  408. '-----------------------------------------------------------
  409.         
  410.         
  411. '-----------------------------------------------------
  412. 'Begin Table-4
  413.     
  414.     Names(28) = "Text41"
  415.     Types(28) = typeString
  416.     IDs(28) = idTxt41
  417.     Defaults(28) = ""
  418.         
  419. 'End Table-4
  420. '-----------------------------------------------------------
  421.         
  422.  '-----------------------------------------------------
  423. 'Begin Scale
  424.     
  425.     Names(29) = "SymTxtHeight"
  426. '    Types(29) = typeString
  427.     Types(29) = typeDouble
  428.     IDs(29) = idSymTxtHeight
  429. '    Defaults(29) = "0.3"
  430.     Defaults(29) = 0.3
  431.         
  432. 'End Scale
  433. '-----------------------------------------------------------
  434. 'Begin TextFont
  435.     
  436.     Names(47) = "FontTxt"
  437.     Types(47) = typeString
  438.     IDs(47) = idTextFont
  439.     Defaults(47) = "Times New Roman"
  440.         
  441. 'End TextFont
  442.  
  443. 'Begin TextFont
  444.     
  445.     Names(48) = "UnitName"
  446.     Types(48) = typeString
  447.     IDs(48) = idUnitName
  448.     Defaults(48) = "in"
  449.         
  450. 'End TextFont
  451.  
  452.       
  453.     GetPropertyInfo = NUM_PROPERTIES
  454. End Function
  455.  
  456. 'Get the number of property pages supporting this RegenMethod
  457. Public Function GetPageInfo(ByVal AGraphic As Object, StockPages As Long, _
  458.     Names As Variant) As Long
  459.     ReDim Names(NUM_PAGES)
  460.  
  461.     'Need the form
  462.     Load frmSample
  463.     Names(0) = frmSample.Caption
  464.     Unload frmSample
  465.  
  466.     StockPages = ppStockBrush + ppStockPen + ppStockAuto
  467.     GetPageInfo = NUM_PAGES
  468. End Function
  469.  
  470. Public Function GetWizardInfo(Names As Variant) As Long
  471.     ReDim Names(NUM_WIZARDS)
  472.     GetWizardInfo = NUM_WIZARDS
  473. End Function
  474.  
  475. 'Enumerate the names and values of a specified property
  476. Public Function GetEnumNames(ByVal PropID As Long, Names As Variant, Values As Variant) As Long
  477.     GetEnumNames = 0
  478. End Function
  479.  
  480. Public Function PageControls(ByVal ThisRegenMethod As Object, ByVal theGraphic As Object, ByVal PageNumber As Long, ByVal SaveProperties As Boolean) As Boolean
  481.         'Set up error function
  482.         On Error GoTo Failed
  483.  
  484.         Dim grfThis As Graphic
  485.         Set grfThis = theGraphic
  486.         Set App = grfThis.Application
  487.         If SaveProperties Then
  488.             'OK button on property page was clicked
  489.             'Form is still loaded
  490. '            With frmSample
  491.                 'Need On Error statement for the case where you have
  492.                 'RRect Turbo Shape and ahother "shape" selected
  493. '                On Error Resume Next
  494.  
  495. '            End With
  496.  
  497. ' ------------------------------------------------------------------------
  498.                   
  499.                    ' Table-1
  500.             grfThis.Properties("Image11") = Im11
  501.             grfThis.Properties("Image12") = Im12
  502.             grfThis.Properties("Image13") = Im13
  503.             grfThis.Properties("Image14") = Im14
  504.             grfThis.Properties("Image15") = Im15
  505.             grfThis.Properties("Image16") = Im16
  506.             grfThis.Properties("Image17") = Im17
  507.             grfThis.Properties("Image18") = Im18
  508.             
  509.             grfThis.Properties("ImageFont11") = ImF11
  510.             grfThis.Properties("ImageFont12") = ImF12
  511.             grfThis.Properties("ImageFont13") = ImF13
  512.             grfThis.Properties("ImageFont14") = ImF14
  513.             grfThis.Properties("ImageFont15") = ImF15
  514.             grfThis.Properties("ImageFont16") = ImF16
  515.             grfThis.Properties("ImageFont17") = ImF17
  516.             grfThis.Properties("ImageFont18") = ImF18
  517.            
  518.             grfThis.Properties("Text11") = Str11
  519.             grfThis.Properties("Text12") = Str12
  520.             grfThis.Properties("Text13") = Str13
  521.             grfThis.Properties("Text14") = Str14
  522.             grfThis.Properties("Text15") = Str15
  523.  
  524.  
  525.                    ' Table-2
  526.             grfThis.Properties("Image21") = Im21
  527.             grfThis.Properties("Image22") = Im22
  528.             grfThis.Properties("Image23") = Im23
  529.             grfThis.Properties("Image24") = Im24
  530.             grfThis.Properties("Image25") = Im25
  531.             grfThis.Properties("Image26") = Im26
  532.             grfThis.Properties("Image27") = Im27
  533.             grfThis.Properties("Image28") = Im28
  534.             
  535.             grfThis.Properties("ImageFont21") = ImF21
  536.             grfThis.Properties("ImageFont22") = ImF22
  537.             grfThis.Properties("ImageFont23") = ImF23
  538.             grfThis.Properties("ImageFont24") = ImF24
  539.             grfThis.Properties("ImageFont25") = ImF25
  540.             grfThis.Properties("ImageFont26") = ImF26
  541.             grfThis.Properties("ImageFont27") = ImF27
  542.             grfThis.Properties("ImageFont28") = ImF28
  543.  
  544.             grfThis.Properties("Text21") = Str21
  545.             grfThis.Properties("Text22") = Str22
  546.             grfThis.Properties("Text23") = Str23
  547.             grfThis.Properties("Text24") = Str24
  548.             grfThis.Properties("Text25") = Str25
  549.  
  550.  
  551.                    ' Table-3
  552.             grfThis.Properties("Image31") = Im31
  553.             grfThis.Properties("ImageFont31") = ImF31
  554.             grfThis.Properties("Text31") = Str31
  555.  
  556.                    ' Table-4
  557.             grfThis.Properties("Text41") = Str41
  558.  
  559.                    ' Scale symbol
  560.             grfThis.Properties("SymTxtHeight") = SymTxtHeight
  561.                    
  562.                    ' Text Font
  563.             If frmSample.CheckFont.Value = 1 Then
  564.                 TextF = grfThis.Drawing.Properties("TextFont")
  565.             End If
  566.             grfThis.Properties("FontTxt") = TextF
  567.                    
  568.         Else
  569.             'Property page is about to be opened
  570.             'Make sure the form is loaded
  571. '             Load frmSample
  572.             Im11 = Chr(98)
  573.             Im12 = Chr(110)
  574.             Im13 = Chr(109)
  575.             Im14 = ""
  576.             Im15 = ""
  577.             Im16 = ""
  578.             Im17 = ""
  579.             Im18 = ""
  580.             ImF11 = "gdt.shx"
  581.             ImF12 = "gdt.shx"
  582.             ImF13 = "gdt.shx"
  583.             Str11 = "0.000"
  584.             Str12 = ""
  585.             Str13 = "A"
  586.             Str14 = "B"
  587.             Str15 = "C"
  588.             
  589.             Im21 = ""
  590.             Im22 = ""
  591.             Im23 = ""
  592.             Im24 = ""
  593.             Im25 = ""
  594.             Im26 = ""
  595.             Im27 = ""
  596.             Im28 = ""
  597.             
  598.             Str21 = ""
  599.             Str22 = ""
  600.             Str23 = ""
  601.             Str24 = ""
  602.             Str25 = ""
  603.  
  604.             Im31 = ""
  605.             Str31 = ""
  606.                    
  607.             Str41 = ""
  608.                 
  609.             SymTxtHeight = 0.3
  610.             
  611.             TextF = "Times New Roman"
  612.                    ' Table-1
  613.             On Error Resume Next
  614.             Im11 = grfThis.Properties("Image11")
  615.             Im12 = grfThis.Properties("Image12")
  616.             Im13 = grfThis.Properties("Image13")
  617.             Im14 = grfThis.Properties("Image14")
  618.             Im15 = grfThis.Properties("Image15")
  619.             Im16 = grfThis.Properties("Image16")
  620.             Im17 = grfThis.Properties("Image17")
  621.             Im18 = grfThis.Properties("Image18")
  622.             
  623.             ImF11 = grfThis.Properties("ImageFont11")
  624.             ImF12 = grfThis.Properties("ImageFont12")
  625.             ImF13 = grfThis.Properties("ImageFont13")
  626.             ImF14 = grfThis.Properties("ImageFont14")
  627.             ImF15 = grfThis.Properties("ImageFont15")
  628.             ImF16 = grfThis.Properties("ImageFont16")
  629.             ImF17 = grfThis.Properties("ImageFont17")
  630.             ImF18 = grfThis.Properties("ImageFont18")
  631.                                  
  632.             Str11 = grfThis.Properties("Text11")
  633.             Str12 = grfThis.Properties("Text12")
  634.             Str13 = grfThis.Properties("Text13")
  635.             Str14 = grfThis.Properties("Text14")
  636.             Str15 = grfThis.Properties("Text15")
  637.  
  638.  
  639.                    ' Table-2
  640.             Im21 = grfThis.Properties("Image21")
  641.             Im22 = grfThis.Properties("Image22")
  642.             Im23 = grfThis.Properties("Image23")
  643.             Im24 = grfThis.Properties("Image24")
  644.             Im25 = grfThis.Properties("Image25")
  645.             Im26 = grfThis.Properties("Image26")
  646.             Im27 = grfThis.Properties("Image27")
  647.             Im28 = grfThis.Properties("Image28")
  648.             
  649.             ImF21 = grfThis.Properties("ImageFont21")
  650.             ImF22 = grfThis.Properties("ImageFont22")
  651.             ImF23 = grfThis.Properties("ImageFont23")
  652.             ImF24 = grfThis.Properties("ImageFont24")
  653.             ImF25 = grfThis.Properties("ImageFont25")
  654.             ImF26 = grfThis.Properties("ImageFont26")
  655.             ImF27 = grfThis.Properties("ImageFont27")
  656.             ImF28 = grfThis.Properties("ImageFont28")
  657.  
  658.             Str21 = grfThis.Properties("Text21")
  659.             Str22 = grfThis.Properties("Text22")
  660.             Str23 = grfThis.Properties("Text23")
  661.             Str24 = grfThis.Properties("Text24")
  662.             Str25 = grfThis.Properties("Text25")
  663.  
  664.  
  665.                    ' Table-3
  666.             Im31 = grfThis.Properties("Image31")
  667.             ImF31 = grfThis.Properties("ImageFont31")
  668.             Str31 = grfThis.Properties("Text31")
  669.  
  670.                    ' Table-4
  671.             Str41 = grfThis.Properties("Text41")
  672.             
  673.                    ' Scale Symbol
  674.             SymTxtHeight = grfThis.Properties("SymTxtHeight")
  675.                 
  676.                     'Text Font
  677.             TextF = grfThis.Properties("FontTxt")
  678.                     
  679.             Load frmSample
  680.         End If
  681.         
  682. ''        Set App = Nothing
  683.  
  684.         PageControls = True
  685.         Exit Function
  686.  
  687. Failed:
  688.         'For debugging purposes, report that an error occurred
  689.         If Err.Number <> 0 Then
  690. '            MsgBox "Error in PageControls: " & Err.Description
  691.         End If
  692. ''        Set App = Nothing
  693.         'Return false if an error occurred
  694.         PageControls = False
  695. End Function
  696.  
  697. Public Function PageDone(ByVal ThisRegenMethod As Object, Optional PageNumber As Variant)
  698.         'Done with form
  699.         Unload frmSample
  700.         Set App = Nothing
  701. End Function
  702.  
  703. Public Function PropertyPages(ByVal ThisRegenMethod As Object, Optional PageNumber As Variant) As Boolean
  704.     With frmSample
  705.         .Show vbModal
  706.         PropertyPages = Not .DialogCanceled
  707.     End With
  708. End Function
  709.  
  710. Public Function Wizard(ByVal ThisRegenMethod As Object, Optional WizardNumber As Variant) As Boolean
  711.     Wizard = False
  712. End Function
  713.  
  714. 'Called when vertex has been moved, or other geometry change
  715. Public Function OnGeometryChanged(ByVal Graphic As Object, ByVal GeomID As Long, paramOld As Variant, paramNew As Variant)
  716.     'Do nothing
  717.     'Regen Graphic
  718. End Function
  719.  
  720. 'Called when vertex is moved, or other geometry change
  721. Public Function OnGeometryChanging(ByVal Graphic As Object, ByVal GeomID As Long, paramOld As Variant, paramNew As Variant) As Boolean
  722.     'OK to continue with change
  723.     OnGeometryChanging = True
  724. End Function
  725.  
  726. Public Function OnNewGraphic(ByVal theGraphic As Object, ByVal boolCopy As Boolean) As Boolean
  727.     If boolCopy Then
  728.         'Vertices are already added for us...
  729.         OnNewGraphic = True
  730.         Exit Function
  731.     End If
  732.  
  733.     On Error GoTo Failed
  734. '    Dim App As Object
  735.     Dim grfThis As Graphic
  736.     Set grfThis = theGraphic
  737. '    Set App = grfThis.Application
  738. '    strPath = App.Path & "\SDKBitMap\"
  739.     'New Graphic being created
  740. 'Dim R#
  741. '    R = CDbl(ScaleSymTxt) * R0
  742.     'X, Y, Z, PenDown, Selectable, Snappable, Editable, Linkable
  743.     'First Vertex is "lower left" corner
  744.     grfThis.Vertices.Add 0#, 0#, 0#, False, True, False, True, False
  745.     'Second Vertex is "lower right" corner
  746.     grfThis.Vertices.Add 4#, 0#, 0#, False, True, False, True, False
  747.     'Third Vertex is "upper right" corner
  748. '    grfThis.Vertices.Add 4#, R, 0#, False, False, False, False, False
  749.     'Fourth Vertex is "upper left" corner
  750. '    grfThis.Vertices.Add 0#, R, 0#, False, False, False, False, False
  751.      '5 Vertex is editable "lower left" corner
  752. '    grfThis.Vertices.Add 0#, 0#, 0#, False, False, False, False, False
  753.     '6 Vertex is editable "lower right" corner
  754. '    grfThis.Vertices.Add 4#, 0#, 0#, False, False, False, False, False
  755.     '7 Vertex is editable "upper right" corner
  756. '    grfThis.Vertices.Add 4#, R, 0#, False, False, False, False, False
  757.     '8 Vertex is editable "upper left" corner
  758. '    grfThis.Vertices.Add 0#, R, 0#, False, False, False, False, False
  759.    Len0 = 4#
  760.    grfThis.Properties("LimitVertices") = 2
  761.     OnNewGraphic = True
  762.     Exit Function
  763.  
  764. Failed:
  765.     'Return false on failure
  766.     OnNewGraphic = False
  767. End Function
  768.  
  769. 'Function called whenever a copy of a graphic is being made
  770. Public Function OnCopyGraphic(ByVal grfCopy As Object, ByVal grfSource As Object) As Boolean
  771.     'Return false on failure
  772.     OnCopyGraphic = True
  773. End Function
  774.  
  775. 'Notification function called after graphic property is saved
  776. Public Function OnPropertyChanged(ByVal Graphic As Object, ByVal PropID As Long, _
  777.         ValueOld As Variant, ValueNew As Variant)
  778.     'Do nothing
  779. End Function
  780.  
  781. 'Notification function called when graphic property is saved
  782. Public Function OnPropertyChanging(ByVal Graphic As Object, ByVal PropID As Long, _
  783.         ValueOld As Variant, ValueNew As Variant) As Boolean
  784.     'OK to proceed
  785.     OnPropertyChanging = True
  786. End Function
  787.  
  788. 'Notification function called when graphic property is retrieved
  789. Public Function OnPropertyGet(ByVal theGraphic As Object, ByVal PropID As Long)
  790.     'Do nothing
  791. End Function
  792.  
  793. 'Called when we need to update our object
  794. Public Function Regen(ByVal theGraphic As Object)
  795. Dim Ver As Vertex
  796. LLL:        'Setup error handler
  797.         On Error GoTo Failed
  798.         
  799.         'Set up lock (prevent recursion)
  800.         Dim LockCount&
  801.         Dim grfThis As Graphic
  802.         Set grfThis = theGraphic
  803. '        grfThis.Properties("PenStyle") = "CONTINUOUS"
  804.         ''On Error Resume Next
  805.         ''grfThis.Properties("PenStyle") = "CONTINUOUS"
  806.         ''Err.Clear
  807.         ''On Error GoTo Failed
  808.  
  809. Dim NameUnit$
  810.         NameUnit = grfThis.Drawing.Properties("LinearUnitName")
  811.         If NameUnit = "mm" And grfThis.Properties("UnitName") = "in" Then
  812.             grfThis.Properties("UnitName") = "mm"
  813.             grfThis.Properties("SymTxtHeight") = grfThis.Properties("SymTxtHeight") * 25.4
  814.         End If
  815. If grfThis.Vertices.Count = 0 Then
  816.     'First Vertex is "lower left" corner
  817.     grfThis.Vertices.Add 0#, 0#, 0#, False, True, False, True, False
  818.     'Second Vertex is "lower right" corner
  819.     grfThis.Vertices.Add 4#, 0#, 0#, False, False, False, False, False
  820. End If
  821. R0 = 0.25
  822.  
  823.         LockCount& = grfThis.RegenLock
  824. 'MsgBox (grfThis.Drawing.Properties("LinearUnitName"))
  825.    
  826.         'Setup error handler (make sure lock is removed)
  827.         On Error GoTo FailedLock
  828.         If LockCount& = 0 Then
  829.                    ' Table-1
  830.             With grfThis
  831.                 Im11 = .Properties("Image11")
  832.                 Im12 = .Properties("Image12")
  833.                 Im13 = .Properties("Image13")
  834.                 Im14 = .Properties("Image14")
  835.                 Im15 = .Properties("Image15")
  836.                 Im16 = .Properties("Image16")
  837.                 Im17 = .Properties("Image17")
  838.                 Im18 = .Properties("Image18")
  839.                 ImF11 = .Properties("ImageFont11")
  840.                 ImF12 = .Properties("ImageFont12")
  841.                 ImF13 = .Properties("ImageFont13")
  842.                 ImF14 = .Properties("ImageFont14")
  843.                 ImF15 = .Properties("ImageFont15")
  844.                 ImF16 = .Properties("ImageFont16")
  845.                 ImF17 = .Properties("ImageFont17")
  846.                 ImF18 = .Properties("ImageFont18")
  847.                 Str11 = .Properties("Text11")
  848.                 Str12 = .Properties("Text12")
  849.                 Str13 = .Properties("Text13")
  850.                 Str14 = .Properties("Text14")
  851.                 Str15 = .Properties("Text15")
  852.     
  853.                        ' Table-2
  854.                 Im21 = .Properties("Image21")
  855.                 Im22 = .Properties("Image22")
  856.                 Im23 = .Properties("Image23")
  857.                 Im24 = .Properties("Image24")
  858.                 Im25 = .Properties("Image25")
  859.                 Im26 = .Properties("Image26")
  860.                 Im27 = .Properties("Image27")
  861.                 Im28 = .Properties("Image28")
  862.                 ImF21 = .Properties("ImageFont21")
  863.                 ImF22 = .Properties("ImageFont22")
  864.                 ImF23 = .Properties("ImageFont23")
  865.                 ImF24 = .Properties("ImageFont24")
  866.                 ImF25 = .Properties("ImageFont25")
  867.                 ImF26 = .Properties("ImageFont26")
  868.                 ImF27 = .Properties("ImageFont27")
  869.                 ImF28 = .Properties("ImageFont28")
  870.                 Str21 = .Properties("Text21")
  871.                 Str22 = .Properties("Text22")
  872.                 Str23 = .Properties("Text23")
  873.                 Str24 = .Properties("Text24")
  874.                 Str25 = .Properties("Text25")
  875.     
  876.                        ' Table-3
  877.                 Im31 = .Properties("Image31")
  878.                 ImF31 = .Properties("ImageFont31")
  879.                 Str31 = .Properties("Text31")
  880.     
  881.                        ' Table-4
  882.                 Str41 = .Properties("Text41")
  883.                 
  884.                        ' Scale Symbol
  885.                 SymTxtHeight = .Properties("SymTxtHeight")
  886.                     ' Text Font
  887.                 TextF = .Properties("FontTxt").Value
  888.             End With
  889.             
  890. Dim Col As Long
  891.         Col = grfThis.Properties("PenColor")
  892.  
  893. Dim R#
  894.             R = SymTxtHeight * 0.625
  895.             'Delete any previous cosmetic children
  896.             grfThis.Graphics.Clear gfCosmetic
  897.  
  898.             Dim boolHandleMoved As Boolean
  899.             'Add child Graphics
  900.             Dim grfChild As Graphic
  901.             Dim X0#, Y0#, X1#, Y1#, T#
  902. Dim Z0#
  903.             With grfThis.Vertices
  904.                 X0# = .Item(0).X
  905.                 Y0# = .Item(0).Y
  906.                 Z0# = .Item(0).Z
  907.             End With
  908.             
  909.        Dim Salp#, Calp#, l#
  910.             Dim X00#, Y00#, X01#, Y01#
  911.             With grfThis.Vertices
  912.                 X00 = .Item(0).X
  913.                 Y00 = .Item(0).Y
  914.                 X01 = .Item(1).X
  915.                 Y01 = .Item(1).Y
  916.                 l = Sqr((X01 - X00) * (X01 - X00) + (Y01 - Y00) * (Y01 - Y00))
  917.                 Salp = (Y01 - Y00) / l
  918.                 Calp = (X01 - X00) / l
  919.             End With
  920. Dim alp#
  921.             alp = Angle(Salp, Calp)
  922. Dim i As Integer
  923. Dim Xb#, Yb#
  924. Dim Ymid#, Xb1#
  925. Dim Symb As String
  926.     
  927.   If Mid(Im11, 1, 1) = Mid(Im21, 1, 1) And Im11 <> "" Then
  928.     Ymid = Y0 - R
  929.   Else
  930.     Ymid = Y0
  931.   End If
  932. ' -------------------------------------------------------------
  933.  Dim D#
  934.  D = 2# * R
  935.  If Im11 <> "" Then
  936.      
  937.      Symb = Mid(Im11, 1, 1)
  938.      If Mid(Im11, 1, 1) = Chr(116) Then
  939.         Set grfChild = grfThis.Graphics.AddText(Symb, X0 + 0.08 * R, Ymid + 0.75 * D, Z0, 0.55 * D)
  940.      Else
  941.         Set grfChild = grfThis.Graphics.AddText(Symb, X0 + 0.1 * R, Ymid + 0.75 * D, Z0, 0.7 * D)
  942.      End If
  943.      With grfChild
  944.         .Properties("TextFont") = ImF11 '"gdt.shx"
  945.         .Properties("TextStyle") = 0
  946.         .Properties("PenColor") = Col
  947.         .Cosmetic = True
  948.     End With
  949.  Else
  950.    Xb = X0
  951.    Yb = Y0
  952.    GoTo L1
  953.  End If
  954.  
  955. '------------------------------------------------------
  956.         Set grfChild = grfThis.Graphics.Add(11)
  957.         With grfChild.Vertices
  958.             .Add X0 + D, Y0, Z0
  959.             .Add X0 + D, Y0 + D, Z0
  960.         End With
  961.                 grfChild.Properties("PenColor") = Col
  962.                 grfChild.Cosmetic = True
  963. '--------------------------------------------------------------
  964.  
  965.  Xb = X0 + D
  966.  Yb = Y0
  967.  Xb1 = Xb
  968. L1:
  969.  If Mid(Im12, 1, 1) = Chr(110) Then
  970.     Symb = Mid(Im12, 1, 1)
  971.     Set grfChild = grfThis.Graphics.AddText(Symb, Xb + 0.15 * D, Yb + 0.75 * D, Z0, 0.75 * D)
  972.      With grfChild
  973.         .Properties("TextFont") = ImF12 '"gdt.shx"
  974.         .Properties("TextStyle") = 0
  975.         .Properties("PenColor") = Col
  976.         .Cosmetic = True
  977.     End With
  978.  
  979.     Xb = Xb + D
  980.     Yb = Y0
  981.  End If
  982. '---------------------------------------------------------------
  983. ' Text Fild - Text1=Str1
  984.  If Len(Str11) > 0 Then
  985.     If Im12 <> "" Then
  986.         Set grfChild = grfThis.Graphics.AddText(Str11, Xb - 0.3 * R, Yb + 0.9 * D, Z0, 0.8 * D, 0)
  987.     Else
  988.         Set grfChild = grfThis.Graphics.AddText(Str11, Xb + 0.2 * R, Yb + 0.9 * D, Z0, 0.8 * D, 0)
  989.     End If
  990.      With grfChild
  991.         .Properties("TextFont") = TextF '"gdt.shx"
  992.         .Properties("TextStyle") = 0
  993.         .Properties("PenColor") = Col
  994.         .Cosmetic = True
  995.         Xb = .CalcBoundingBox.Max.X
  996.     End With
  997.     Yb = Y0
  998.  End If
  999. ' ---------------------------------------------------------
  1000.  If Im13 <> "" Then
  1001.     Symb = Mid(Im13, 1, 1)
  1002.     Set grfChild = grfThis.Graphics.AddText(Symb, Xb + 0.1 * R, Yb + 0.75 * D, Z0, 0.7 * D)
  1003.      With grfChild
  1004.         .Properties("TextFont") = ImF13 '"gdt.shx"
  1005.         .Properties("TextStyle") = 0
  1006.         .Properties("PenColor") = Col
  1007.         .Cosmetic = True
  1008.     End With
  1009.     Xb = Xb + D
  1010.     Yb = Y0
  1011.  End If
  1012. '------------------------------------------------------
  1013.         Set grfChild = grfThis.Graphics.Add(11)
  1014.         With grfChild.Vertices
  1015.             .Add Xb, Y0, Z0
  1016.             .Add Xb, Y0 + D, Z0
  1017.         End With
  1018.                 grfChild.Properties("PenColor") = Col
  1019.                 grfChild.Cosmetic = True
  1020. '--------------------------------------------------------------
  1021.  
  1022.  
  1023.  
  1024. ' >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  1025. ' Table-1  Datum-2
  1026.  If Mid(Im14, 1, 1) = Chr(110) Then
  1027.                 
  1028.     Symb = Mid(Im14, 1, 1)
  1029.     Set grfChild = grfThis.Graphics.AddText(Symb, Xb + 0.15 * D, Yb + 0.75 * D, Z0, 0.75 * D)
  1030.      With grfChild
  1031.         .Properties("TextFont") = ImF14 '"gdt.shx"
  1032.         .Properties("TextStyle") = 0
  1033.         .Properties("PenColor") = Col
  1034.         .Cosmetic = True
  1035.     End With
  1036.     Xb = Xb + D
  1037.     Yb = Y0
  1038.  End If
  1039. '---------------------------------------------------------------
  1040. ' Text Fild - Text1=Str1
  1041.  If Len(Str12) > 0 Then
  1042.     If Im14 <> "" Then
  1043.         Set grfChild = grfThis.Graphics.AddText(Str12, Xb - 0.3 * R, Yb + 0.9 * D, Z0, 0.8 * D, 0)
  1044.     Else
  1045.         Set grfChild = grfThis.Graphics.AddText(Str12, Xb + 0.2 * R, Yb + 0.9 * D, Z0, 0.8 * D, 0)
  1046.     End If
  1047.      With grfChild
  1048.         .Properties("TextFont") = TextF '"gdt.shx"
  1049.         .Properties("TextStyle") = 0
  1050.         .Properties("PenColor") = Col
  1051.         .Cosmetic = True
  1052.         Xb = .CalcBoundingBox.Max.X
  1053.     End With
  1054.     Yb = Y0
  1055.  End If
  1056. ' ---------------------------------------------------------
  1057.  If Im15 <> "" Then
  1058.     Symb = Mid(Im15, 1, 1)
  1059.     Set grfChild = grfThis.Graphics.AddText(Symb, Xb + 0.1 * R, Yb + 0.75 * D, Z0, 0.7 * D)
  1060.      With grfChild
  1061.         .Properties("TextFont") = ImF15 '"gdt.shx"
  1062.         .Properties("TextStyle") = 0
  1063.         .Properties("PenColor") = Col
  1064.         .Cosmetic = True
  1065.     End With
  1066.     Xb = Xb + D
  1067.     Yb = Y0
  1068.  End If
  1069. '------------------------------------------------------
  1070.         Set grfChild = grfThis.Graphics.Add(11)
  1071.         With grfChild.Vertices
  1072.             .Add Xb, Y0, Z0
  1073.             .Add Xb, Y0 + D, Z0
  1074.         End With
  1075.                 grfChild.Properties("PenColor") = Col
  1076.                 grfChild.Cosmetic = True
  1077. '-------------------------------------------------------------
  1078.  
  1079. '>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  1080.  
  1081. ' Text Filds Text2=Str2  Text3=Str3  Text4=Str4
  1082. If Len(Str13) > 0 Then
  1083.     Set grfChild = grfThis.Graphics.AddText(Str13, Xb + 0.3 * R, Yb + 0.9 * D, Z0, 0.8 * D, 0)
  1084.      With grfChild
  1085.         .Properties("TextFont") = TextF '"gdt.shx"
  1086.         .Properties("TextStyle") = 0
  1087.         .Properties("PenColor") = Col
  1088.         .Cosmetic = True
  1089.         Xb = .CalcBoundingBox.Max.X + 0.3 * R
  1090.     End With
  1091.     Yb = Y0
  1092.     If Im16 <> "" Then
  1093.         Xb = Xb - 0.3 * R
  1094.         Symb = Mid(Im16, 1, 1)
  1095.         Set grfChild = grfThis.Graphics.AddText(Symb, Xb + 0.1 * R, Yb + 0.75 * D, Z0, 0.7 * D)
  1096.      With grfChild
  1097.         .Properties("TextFont") = ImF16 '"gdt.shx"
  1098.         .Properties("TextStyle") = 0
  1099.         .Properties("PenColor") = Col
  1100.         .Cosmetic = True
  1101.     End With
  1102.         Xb = Xb + D
  1103.         Yb = Y0
  1104.     End If
  1105. '------------------------------------------------------
  1106.     
  1107.     Set grfChild = grfThis.Graphics.Add(11)
  1108.         With grfChild.Vertices
  1109.             .Add Xb, Y0, Z0
  1110.             .Add Xb, Y0 + D, Z0
  1111.         End With
  1112.                 grfChild.Properties("PenColor") = Col
  1113.                 grfChild.Cosmetic = True
  1114. '------------------------------------------------------
  1115.  
  1116. End If
  1117.  
  1118.  
  1119. If Len(Str14) > 0 Then
  1120.     Set grfChild = grfThis.Graphics.AddText(Str14, Xb + 0.3 * R, Yb + 0.9 * D, Z0, 0.8 * D, 0)
  1121.      With grfChild
  1122.         .Properties("TextFont") = TextF '"gdt.shx"
  1123.         .Properties("TextStyle") = 0
  1124.         .Properties("PenColor") = Col
  1125.         .Cosmetic = True
  1126.         Xb = .CalcBoundingBox.Max.X + 0.3 * R
  1127.     End With
  1128.     Yb = Y0
  1129.     If Im17 <> "" Then
  1130.         Xb = Xb - 0.3 * R
  1131.         Symb = Mid(Im17, 1, 1)
  1132.         Set grfChild = grfThis.Graphics.AddText(Symb, Xb + 0.1 * R, Yb + 0.75 * D, Z0, 0.7 * D)
  1133.          With grfChild
  1134.             .Properties("TextFont") = ImF17 '"gdt.shx"
  1135.             .Properties("TextStyle") = 0
  1136.             .Properties("PenColor") = Col
  1137.             .Cosmetic = True
  1138.         End With
  1139.         Xb = Xb + D
  1140.         Yb = Y0
  1141.     End If
  1142. ' ------------------------------------------------------------------------
  1143.         Set grfChild = grfThis.Graphics.Add(11)
  1144.         With grfChild.Vertices
  1145.             .Add Xb, Y0, Z0
  1146.             .Add Xb, Y0 + D, Z0
  1147.         End With
  1148.                 grfChild.Properties("PenColor") = Col
  1149.                 grfChild.Cosmetic = True
  1150. ' ------------------------------------------------------------------------
  1151. End If
  1152.  
  1153. If Len(Str15) > 0 Then
  1154.     Set grfChild = grfThis.Graphics.AddText(Str15, Xb + 0.3 * R, Yb + 0.9 * D, Z0, 0.8 * D, 0)
  1155.      With grfChild
  1156.         .Properties("TextFont") = TextF '"gdt.shx"
  1157.         .Properties("TextStyle") = 0
  1158.         .Properties("PenColor") = Col
  1159.         .Cosmetic = True
  1160.         Xb = .CalcBoundingBox.Max.X + 0.3 * R
  1161.     End With
  1162.     Yb = Y0
  1163.     If Im18 <> "" Then
  1164.         Xb = Xb - 0.3 * R
  1165.         Symb = Mid(Im18, 1, 1)
  1166.         Set grfChild = grfThis.Graphics.AddText(Symb, Xb + 0.1 * R, Yb + 0.75 * D, Z0, 0.7 * D)
  1167.          With grfChild
  1168.             .Properties("TextFont") = ImF18 '"gdt.shx"
  1169.             .Properties("TextStyle") = 0
  1170.             .Properties("PenColor") = Col
  1171.             .Cosmetic = True
  1172.         End With
  1173.         Xb = Xb + D
  1174.         Yb = Y0
  1175.     End If
  1176. ' ------------------------------------------------------------------------
  1177.         Set grfChild = grfThis.Graphics.Add(11)
  1178.         With grfChild.Vertices
  1179.             .Add Xb, Y0, Z0
  1180.             .Add Xb, Y0 + D, Z0
  1181.         End With
  1182.                 grfChild.Properties("PenColor") = Col
  1183.                 grfChild.Cosmetic = True
  1184. ' ------------------------------------------------------------------------
  1185. End If
  1186. Dim Len1#
  1187. 'MsgBox ("2222222x0=" & CStr(X0) & "  y0=" & CStr(Y0) & " z0=" & CStr(Z0))
  1188. Dim X10#, Y10#, X11#, Y11#, X12#, Y12#, X13#, Y13#
  1189.             With grfThis.Vertices
  1190.                 .Item(0).X = X0
  1191.                 .Item(0).Y = Y0
  1192.                 .Item(0).Z = Z0
  1193.                 .Item(1).X = Xb
  1194.                 .Item(1).Y = Y0
  1195.                 .Item(1).Z = Z0
  1196. '                X1 = .Item(1).X
  1197. '                Y1 = .Item(1).Y
  1198.                 Len1 = Xb - X0
  1199.                 X10 = .Item(0).X
  1200.                 Y10 = .Item(0).Y
  1201. '                Z0 = .Item(0).Z
  1202.             End With
  1203. Dim dxW#, dyW#
  1204.             dxW = X0 - X10
  1205.             dyW = Y0 - Y10
  1206.             
  1207.             
  1208. 'MsgBox ("333333x0=" & CStr(X0) & "  y0=" & CStr(Y0) & " z0=" & CStr(Z0))
  1209. 'Dim X10#, Y10#, X11#, Y11#, X12#, Y12#, X13#, Y13#
  1210. Dim X14#, Y14#, X15#, Y15#, X16#, Y16#, X17#, Y17#
  1211.               With grfThis.Vertices
  1212.               '--------------------
  1213.                     X10 = X0
  1214.                     Y10 = Y0
  1215.                     X11 = Xb
  1216.                     Y11 = Y0
  1217.                     X12 = Xb
  1218.                     Y12 = Y0 + D
  1219.                     X13 = X0
  1220.                     Y13 = Y0 + D
  1221.  
  1222.               End With
  1223.               
  1224.                     ' Draw Box
  1225.     If Mid(Im11, 1, 1) = Mid(Im21, 1, 1) And Im11 <> "" Then
  1226.         Set grfChild = grfThis.Graphics.Add(11)
  1227.         With grfChild.Vertices
  1228.             .Add Xb1, Y10, Z0
  1229.             .Add X11, Y11, Z0
  1230.         End With
  1231.                 grfChild.Properties("PenColor") = Col
  1232.                         grfChild.Cosmetic = True
  1233.     Else
  1234.         Set grfChild = grfThis.Graphics.Add(11)
  1235.         With grfChild.Vertices
  1236.             .Add X10, Y10, Z0
  1237.             .Add X11, Y11, Z0
  1238.         End With
  1239. 'MsgBox ("Child  x0=" & CStr(grfChild.Vertices.Item(0).X) & " y0=" & CStr(grfChild.Vertices.Item(0).Y))
  1240.         
  1241.                 grfChild.Properties("PenColor") = Col
  1242.                         grfChild.Cosmetic = True
  1243.     End If
  1244.     Set grfChild = grfThis.Graphics.Add(11)
  1245.     With grfChild.Vertices
  1246.         .Add X11, Y11, Z0
  1247.         .Add X12, Y12, Z0
  1248.         .Add X13, Y13, Z0
  1249.         .Add X10, Y10, Z0
  1250.     End With
  1251.                 grfChild.Properties("PenColor") = Col
  1252.                     grfChild.Cosmetic = True
  1253.               
  1254. ' Table - 2 Begin Table - 2 Begin Table - 2 Begin Table - 2 Begin
  1255. ' Table - 2 Begin Table - 2 Begin Table - 2 Begin Table - 2 Begin
  1256. ' Table - 2 Begin Table - 2 Begin Table - 2 Begin Table - 2 Begin
  1257.               
  1258.  If Im21 <> "" Or Im22 <> "" Or Im23 <> "" Or Im24 <> "" Or Im25 <> "" Or Im26 <> "" Or Im27 <> "" Or Im28 <> "" Or Str21 <> "" Or Str22 <> "" Or Str23 <> "" Or Str24 <> "" Or Str25 <> "" Then
  1259.     Y0 = Y0 - D
  1260.     If Mid(Im11, 1, 1) = Mid(Im21, 1, 1) And Im11 <> "" Then
  1261. '        Xb = Xb1
  1262.         GoTo L12
  1263.     End If
  1264.     If Im21 <> "" Then
  1265.         Symb = Mid(Im21, 1, 1)
  1266.         If Mid(Im21, 1, 1) = Chr(116) Then
  1267.             Set grfChild = grfThis.Graphics.AddText(Symb, X0 + 0.08 * R, Y0 + 0.75 * D, Z0, 0.55 * D)
  1268.         Else
  1269.             Set grfChild = grfThis.Graphics.AddText(Symb, X0 + 0.1 * R, Y0 + 0.75 * D, Z0, 0.7 * D)
  1270.         End If
  1271.          With grfChild
  1272.             .Properties("TextFont") = ImF21 '"gdt.shx"
  1273.             .Properties("TextStyle") = 0
  1274.             .Properties("PenColor") = Col
  1275.             .Cosmetic = True
  1276.         End With
  1277.     End If
  1278.     If Im21 = "" Then
  1279.         Xb = X0
  1280.         Yb = Y0
  1281.         GoTo L11
  1282.     End If
  1283. L12:
  1284. '------------------------------------------------------
  1285.      Set grfChild = grfThis.Graphics.Add(11)
  1286.     With grfChild.Vertices
  1287.         .Add X0 + D, Y0, Z0
  1288.         .Add X0 + D, Y0 + D, Z0
  1289.     End With
  1290.                 grfChild.Properties("PenColor") = Col
  1291.                 grfChild.Cosmetic = True
  1292. '--------------------------------------------------------------
  1293.  
  1294.     Xb = X0 + D
  1295.     Yb = Y0
  1296. L11:
  1297.     If Mid(Im22, 1, 1) = Chr(110) Then
  1298.         Symb = Mid(Im22, 1, 1)
  1299.         Set grfChild = grfThis.Graphics.AddText(Symb, Xb + 0.15 * D, Yb + 0.75 * D, Z0, 0.75 * D)
  1300.          With grfChild
  1301.             .Properties("TextFont") = ImF22 '"gdt.shx"
  1302.             .Properties("TextStyle") = 0
  1303.             .Properties("PenColor") = Col
  1304.             .Cosmetic = True
  1305.         End With
  1306.         Xb = Xb + D
  1307.         Yb = Y0
  1308.     End If
  1309. '---------------------------------------------------------------
  1310. ' Text Fild - Text1=Str1
  1311.     If Len(Str21) > 0 Then
  1312.         If Im22 <> "" Then
  1313.             Set grfChild = grfThis.Graphics.AddText(Str21, Xb - 0.3 * R, Yb + 0.9 * D, Z0, 0.8 * D, 0)
  1314.         Else
  1315.             Set grfChild = grfThis.Graphics.AddText(Str21, Xb + 0.2 * R, Yb + 0.9 * D, Z0, 0.8 * D, 0)
  1316.         End If
  1317.          With grfChild
  1318.             .Properties("TextFont") = TextF '"gdt.shx"
  1319.             .Properties("TextStyle") = 0
  1320.             .Properties("PenColor") = Col
  1321.             .Cosmetic = True
  1322.             Xb = .CalcBoundingBox.Max.X
  1323.         End With
  1324.         Yb = Y0
  1325.     End If
  1326. ' ---------------------------------------------------------
  1327.     If Im23 <> "" Then
  1328.         Symb = Mid(Im23, 1, 1)
  1329.         Set grfChild = grfThis.Graphics.AddText(Symb, Xb + 0.1 * R, Yb + 0.75 * D, Z0, 0.7 * D)
  1330.          With grfChild
  1331.             .Properties("TextFont") = ImF23 '"gdt.shx"
  1332.             .Properties("TextStyle") = 0
  1333.             .Properties("PenColor") = Col
  1334.             .Cosmetic = True
  1335.         End With
  1336.         Xb = Xb + D
  1337.         Yb = Y0
  1338.     End If
  1339. '------------------------------------------------------
  1340.         Set grfChild = grfThis.Graphics.Add(11)
  1341.         With grfChild.Vertices
  1342.             .Add Xb, Y0, Z0
  1343.             .Add Xb, Y0 + D, Z0
  1344.         End With
  1345.                 grfChild.Properties("PenColor") = Col
  1346.                 grfChild.Cosmetic = True
  1347. '--------------------------------------------------------------
  1348.  
  1349.  
  1350.  
  1351. ' >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  1352. ' Table-1  Datum-2
  1353.     If Mid(Im24, 1, 1) = Chr(110) Then
  1354.         Symb = Mid(Im24, 1, 1)
  1355.         Set grfChild = grfThis.Graphics.AddText(Symb, Xb + 0.15 * D, Yb + 0.75 * D, Z0, 0.75 * D)
  1356.          With grfChild
  1357.             .Properties("TextFont") = ImF24 '"gdt.shx"
  1358.             .Properties("TextStyle") = 0
  1359.             .Properties("PenColor") = Col
  1360.             .Cosmetic = True
  1361.         End With
  1362.         Xb = Xb + D
  1363.         Yb = Y0
  1364.     End If
  1365. '---------------------------------------------------------------
  1366. ' Text Fild - Text1=Str1
  1367.     If Len(Str22) > 0 Then
  1368.         If Im24 <> "" Then
  1369.             Set grfChild = grfThis.Graphics.AddText(Str22, Xb - 0.3 * R, Yb + 0.9 * D, Z0, 0.8 * D, 0)
  1370.         Else
  1371.             Set grfChild = grfThis.Graphics.AddText(Str22, Xb + 0.2 * R, Yb + 0.9 * D, Z0, 0.8 * D, 0)
  1372.         End If
  1373.          With grfChild
  1374.             .Properties("TextFont") = TextF '"gdt.shx"
  1375.             .Properties("TextStyle") = 0
  1376.             .Properties("PenColor") = Col
  1377.             .Cosmetic = True
  1378.             Xb = .CalcBoundingBox.Max.X
  1379.        End With
  1380.         Yb = Y0
  1381.     End If
  1382. ' ---------------------------------------------------------
  1383.     If Im25 <> "" Then
  1384.         Symb = Mid(Im25, 1, 1)
  1385.         Set grfChild = grfThis.Graphics.AddText(Symb, Xb + 0.1 * R, Yb + 0.75 * D, Z0, 0.7 * D)
  1386.          With grfChild
  1387.             .Properties("TextFont") = ImF25 '"gdt.shx"
  1388.             .Properties("TextStyle") = 0
  1389.             .Properties("PenColor") = Col
  1390.             .Cosmetic = True
  1391.         End With
  1392.         Xb = Xb + D
  1393.         Yb = Y0
  1394.     End If
  1395. '------------------------------------------------------
  1396.         Set grfChild = grfThis.Graphics.Add(11)
  1397.         With grfChild.Vertices
  1398.             .Add Xb, Y0, Z0
  1399.             .Add Xb, Y0 + D, Z0
  1400.         End With
  1401.                 grfChild.Properties("PenColor") = Col
  1402.                 grfChild.Cosmetic = True
  1403. '-------------------------------------------------------------
  1404.  
  1405. '>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  1406.  
  1407.  
  1408. ' Text Filds Text2=Str2  Text3=Str3  Text4=Str4
  1409.     If Len(Str23) > 0 Then
  1410.         Set grfChild = grfThis.Graphics.AddText(Str23, Xb + 0.3 * R, Yb + 0.9 * D, Z0, 0.8 * D)
  1411.          With grfChild
  1412.             .Properties("TextFont") = TextF '"gdt.shx"
  1413.             .Properties("TextStyle") = 0
  1414.             .Properties("PenColor") = Col
  1415.             .Cosmetic = True
  1416.             Xb = .CalcBoundingBox.Max.X + 0.3 * R
  1417.         End With
  1418.         Yb = Y0
  1419.         If Im26 <> "" Then
  1420.             Xb = Xb - 0.3 * R
  1421.             Symb = Mid(Im26, 1, 1)
  1422.            Set grfChild = grfThis.Graphics.AddText(Symb, Xb + 0.1 * R, Yb + 0.75 * D, Z0, 0.7 * D)
  1423.              With grfChild
  1424.                 .Properties("TextFont") = ImF26 '"gdt.shx"
  1425.                 .Properties("TextStyle") = 0
  1426.                 .Properties("PenColor") = Col
  1427.                 .Cosmetic = True
  1428.             End With
  1429.             Xb = Xb + D
  1430.             Yb = Y0
  1431.         End If
  1432. ' --------------------------------------------------------------
  1433.         Set grfChild = grfThis.Graphics.Add(11)
  1434.         With grfChild.Vertices
  1435.             .Add Xb, Y0, Z0
  1436.             .Add Xb, Y0 + D, Z0
  1437.         End With
  1438.                 grfChild.Properties("PenColor") = Col
  1439.                    grfChild.Cosmetic = True
  1440. ' --------------------------------------------------------------------------
  1441.     End If
  1442.  
  1443.  
  1444.     If Len(Str24) > 0 Then
  1445.         Set grfChild = grfThis.Graphics.AddText(Str24, Xb + 0.3 * R, Yb + 0.9 * D, Z0, 0.8 * D, 0)
  1446.          With grfChild
  1447.             .Properties("TextFont") = TextF
  1448.             .Properties("TextStyle") = 0
  1449.             .Properties("PenColor") = Col
  1450.             .Cosmetic = True
  1451.             Xb = .CalcBoundingBox.Max.X + 0.3 * R
  1452.         End With
  1453.         Yb = Y0
  1454.         If Im27 <> "" Then
  1455.             Xb = Xb - 0.3 * R
  1456.             Symb = Mid(Im27, 1, 1)
  1457.             Set grfChild = grfThis.Graphics.AddText(Symb, Xb + 0.1 * R, Yb + 0.75 * D, Z0, 0.7 * D)
  1458.              With grfChild
  1459.                 .Properties("TextFont") = ImF27 '"gdt.shx"
  1460.                 .Properties("TextStyle") = 0
  1461.                 .Properties("PenColor") = Col
  1462.                 .Cosmetic = True
  1463.             End With
  1464.             Xb = Xb + D
  1465.             Yb = Y0
  1466.         End If
  1467. '---------------------------------------------------------------
  1468.         Set grfChild = grfThis.Graphics.Add(11)
  1469.         With grfChild.Vertices
  1470.             .Add Xb, Y0, 0
  1471.             .Add Xb, Y0 + D, 0
  1472.         End With
  1473.                 grfChild.Properties("PenColor") = Col
  1474.                     grfChild.Cosmetic = True
  1475. '---------------------------------------------------------------
  1476.     End If
  1477.  
  1478.     If Len(Str25) > 0 Then
  1479.         Set grfChild = grfThis.Graphics.AddText(Str25, Xb + 0.3 * R, Yb + 0.9 * D, Z0, 0.8 * D, 0)
  1480.          With grfChild
  1481.             .Properties("TextFont") = TextF
  1482.             .Properties("TextStyle") = 0
  1483.             .Properties("PenColor") = Col
  1484.             .Cosmetic = True
  1485.             Xb = .CalcBoundingBox.Max.X + 0.3 * R
  1486.         End With
  1487.         Yb = Y0
  1488.         If Im28 <> "" Then
  1489.             Xb = Xb - 0.3 * R
  1490.             Symb = Mid(Im28, 1, 1)
  1491.             Set grfChild = grfThis.Graphics.AddText(Symb, Xb + 0.1 * R, Yb + 0.75 * D, Z0, 0.7 * D)
  1492.              With grfChild
  1493.                 .Properties("TextFont") = ImF28 '"gdt.shx"
  1494.                 .Properties("TextStyle") = 0
  1495.                 .Properties("PenColor") = Col
  1496.                 .Cosmetic = True
  1497.             End With
  1498.             Xb = Xb + D
  1499.             Yb = Y0
  1500.         End If
  1501.     
  1502.         Set grfChild = grfThis.Graphics.Add(11)
  1503.         With grfChild.Vertices
  1504.             .Add Xb, Y0, Z0
  1505.             .Add Xb, Y0 + D, Z0
  1506.         End With
  1507.                 grfChild.Properties("PenColor") = Col
  1508.                     grfChild.Cosmetic = True
  1509.     End If
  1510.     
  1511.                             ' Draw Box
  1512.  
  1513.     Set grfChild = grfThis.Graphics.Add(11)
  1514.     With grfChild.Vertices
  1515.         .Add X0, Y0 + D, Z0
  1516.         .Add X0, Y0, Z0
  1517.         .Add Xb, Y0, Z0
  1518.     End With
  1519.                 grfChild.Properties("PenColor") = Col
  1520.                 grfChild.Cosmetic = True
  1521.  
  1522.     If Mid(Im11, 1, 1) = Mid(Im21, 1, 1) And Im11 <> "" Then
  1523.         Set grfChild = grfThis.Graphics.Add(11)
  1524.         With grfChild.Vertices
  1525.             .Add Xb1, Y0 + D, Z0
  1526.             .Add Xb, Y0 + D, Z0
  1527.         End With
  1528.                 grfChild.Properties("PenColor") = Col
  1529.                     grfChild.Cosmetic = True
  1530.     Else
  1531.         Set grfChild = grfThis.Graphics.Add(11)
  1532.         With grfChild.Vertices
  1533.             .Add X0, Y0 + D, Z0
  1534.             .Add Xb, Y0 + D, Z0
  1535.         End With
  1536.                 grfChild.Properties("PenColor") = Col
  1537.                     grfChild.Cosmetic = True
  1538.     End If
  1539.  End If
  1540.               
  1541. ' Table - 2 End  Table - 2 End  Table - 2 End  Table - 2 End  Table - 2 End
  1542. ' Table - 2 End  Table - 2 End  Table - 2 End  Table - 2 End  Table - 2 End
  1543. ' Table - 2 End  Table - 2 End  Table - 2 End  Table - 2 End  Table - 2 End
  1544.               
  1545.               
  1546. ' Table - 3 Begin Table - 3 Begin Table - 3 Begin Table - 3 Begin
  1547. ' Table - 3 Begin Table - 3 Begin Table - 3 Begin Table - 3 Begin
  1548. ' Table - 3 Begin Table - 3 Begin Table - 3 Begin Table - 3 Begin
  1549.               
  1550.               
  1551.  If Len(Str31) > 0 Then
  1552.     Y0 = Y0 - D
  1553.  
  1554.     Set grfChild = grfThis.Graphics.AddText(Str31, X0 + 0.3 * R, Y0 + 0.9 * D, Z0, 0.8 * D)
  1555.     With grfChild
  1556.         .Properties("TextFont") = TextF
  1557.         .Properties("TextStyle") = 0
  1558.         .Properties("PenColor") = Col
  1559.         .Cosmetic = True
  1560.         Xb = .CalcBoundingBox.Max.X + 0.3 * R
  1561.     End With
  1562.     Yb = Y0
  1563.     Xb = Xb - 0.5 * R
  1564.     If Mid(Im31, 1, 1) = Chr(112) Then
  1565.         Symb = Mid(Im31, 1, 1)
  1566.         Set grfChild = grfThis.Graphics.AddText(Symb, Xb + 0.2 * R, Yb + 0.75 * D, Z0, 0.7 * D)
  1567.          With grfChild
  1568.             .Properties("TextFont") = ImF31 '"gdt.shx"
  1569.             .Properties("TextStyle") = 0
  1570.             .Properties("PenColor") = Col
  1571.             .Cosmetic = True
  1572.         End With
  1573.         Xb = Xb + D
  1574.         Yb = Y0
  1575.     End If
  1576.     If Im31 = "" Then
  1577.         Xb = Xb + 0.5 * R
  1578.     End If
  1579.                                 ' Draw Box
  1580.                 
  1581.     Set grfChild = grfThis.Graphics.Add(11)
  1582.     With grfChild.Vertices
  1583.         .Add X0, Y0, Z0
  1584.         .Add Xb, Y0, Z0
  1585.         .Add Xb, Y0 + D, Z0
  1586.         .Add X0, Y0 + D, Z0
  1587.         .Add X0, Y0, Z0
  1588.     End With
  1589.                 grfChild.Properties("PenColor") = Col
  1590.                 grfChild.Cosmetic = True
  1591.  End If
  1592.     
  1593.         
  1594. ' Table - 3 End  Table - 3 End  Table - 3 End  Table - 3 End  Table - 3 End
  1595. ' Table - 3 End  Table - 3 End  Table - 3 End  Table - 3 End  Table - 3 End
  1596.               
  1597.               
  1598. ' Table - 4 Begin Table - 4 Begin Table - 4 Begin Table - 4 Begin
  1599. ' Table - 4 Begin Table - 4 Begin Table - 4 Begin Table - 4 Begin
  1600.               
  1601.               
  1602.  If Len(Str41) > 0 Then
  1603.     Y0 = Y0 - D
  1604.  
  1605.     Set grfChild = grfThis.Graphics.AddText(Str41, X0 + 0.3 * R, Y0 + 0.9 * D, Z0, 0.8 * D, 0, , , 1)
  1606.     With grfChild
  1607.         .Properties("TextFont") = TextF
  1608.         .Properties("TextStyle") = 0
  1609.         .Properties("PenColor") = Col
  1610.         .Cosmetic = True
  1611.         Xb = .CalcBoundingBox.Max.X + 0.2 * R
  1612.     End With
  1613.     
  1614.                              ' Draw Box
  1615.                              
  1616.     Set grfChild = grfThis.Graphics.Add(11)
  1617.     With grfChild.Vertices
  1618.         .Add X0, Y0, Z0
  1619.         .Add Xb, Y0, Z0
  1620.         .Add Xb, Y0 + D, Z0
  1621.         .Add X0, Y0 + D, Z0
  1622.         .Add X0, Y0, Z0
  1623.     End With
  1624.                 grfChild.Properties("PenColor") = Col
  1625.                 grfChild.Cosmetic = True
  1626.  
  1627.  End If
  1628.  
  1629. ' Table - 4 End  Table - 4 End  Table - 4 End  Table - 4 End  Table - 4 End
  1630. ' Table - 4 End  Table - 4 End  Table - 4 End  Table - 4 End  Table - 4 End
  1631.         X0 = grfThis.Vertices.Item(0).X
  1632.         Y0 = grfThis.Vertices.Item(0).Y
  1633.         X1 = grfThis.Vertices.Item(1).X
  1634.         Y1 = grfThis.Vertices.Item(1).Y
  1635.  Dim Z1#
  1636.  
  1637.  
  1638. Dim CountCosm As Long, iCosm As Long, nV As Long, iV As Long, xi#, yi#, xir#, yir#
  1639.                 xi = X1 - X0
  1640.                 yi = Y1 - Y0
  1641.                 xir = X0 + xi * Calp - yi * Salp
  1642.                 yir = Y0 + xi * Salp + yi * Calp
  1643.                 grfThis.Vertices.Item(1).X = xir
  1644.                 grfThis.Vertices.Item(1).Y = yir
  1645.         
  1646. 'MsgBox ("x00=" & CStr(X00) & "  y00=" & CStr(Y00)) ' & " z0=" & CStr((Z0 + z1) / 2))
  1647.         CountCosm = grfThis.Graphics.Count
  1648.         For iCosm = 0 To CountCosm - 1
  1649.             Set grfChild = grfThis.Graphics.Item(iCosm)
  1650.             If iCosm <> 0 Then
  1651.                 On Error Resume Next
  1652.                 grfChild.Properties("PenStyle") = "CONTINUOUS"
  1653.                 grfChild.Update
  1654.                 grfChild.Properties("Thickness") = 0
  1655.             End If
  1656.             With grfChild.Vertices
  1657.                  nV = .Count
  1658.                  For iV = 0 To nV - 1
  1659.                      xi = .Item(iV).X - X0
  1660.                      yi = .Item(iV).Y - Y0
  1661.                      xir = X0 + xi * Calp - yi * Salp
  1662.                      yir = Y0 + xi * Salp + yi * Calp
  1663.                      .Item(iV).X = xir
  1664.                      .Item(iV).Y = yir
  1665.                 Next iV
  1666.             End With
  1667.         Next iCosm
  1668.             'Add visible child Graphics
  1669.         End If
  1670.  
  1671.         grfThis.RegenUnlock
  1672.         
  1673.         Exit Function
  1674.  
  1675. FailedLock:
  1676.         'Remove lock
  1677.         grfThis.RegenUnlock
  1678.  
  1679. Failed:
  1680.         'grfThis.Application.PopVertexDefaults
  1681. If Err.Description = "Division by zero" Then GoTo LLL
  1682.         If Err.Number <> 0 Then
  1683.             'MsgBox "Regen error: " & Err.Description
  1684.         End If
  1685. End Function
  1686.  
  1687. Public Function Draw(ByVal grfThis As Object, ByVal view As Object, Optional mat As Variant) As Boolean
  1688.     'Return True if we did the redraw (no further processing necessary, no children will be drawn).
  1689.     'Since this is just a test, we return False to let TurboCAD do the drawing operation.
  1690.     Draw = False
  1691. End Function
  1692.  
  1693. Private Function Angle(sinb As Double, cosb As Double) As Double
  1694.  
  1695.         If Abs(cosb) < 0.0001 Then
  1696.             If sinb > 0 Then
  1697.                 Angle = pi / 2
  1698.             Else
  1699.                 Angle = 3 * pi / 2
  1700.             End If
  1701.         Else
  1702.             If sinb >= 0 And cosb > 0 Then Angle = Atn(sinb / cosb)
  1703.             If sinb >= 0 And cosb < 0 Then Angle = pi + Atn(sinb / cosb)
  1704.             If sinb < 0 And cosb < 0 Then Angle = pi + Atn(sinb / cosb)
  1705.             If sinb < 0 And cosb > 0 Then Angle = 2 * pi + Atn(sinb / cosb)
  1706.         End If
  1707. End Function
  1708.  
  1709.